'use strict';

angular.module('app')
  .controller('myPostCtrl', [
    '$scope',
    '$http',
    function($scope, $http) {
      $scope.tabList = [{
        id: 'all',
        name: '全部'
      }, {
        id: 'pass',
        name: '邀请面试'
      }, {
        id: 'fail',
        name: '不合适'
      }];
      $http.get('data/myPost.json')
        .then(function(success) {
          $scope.positionList = success.data;
          console.log($scope.positionList);
        }, function(error) {
          /* body... */
        });
      $scope.filterObj = {};
      $scope.tClick = function(id, name) {
        switch (id) {
          case 'all':
            delete $scope.filterObj.state;

            break;
          case 'pass':
            $scope.filterObj.state = "1";
            break;
          case 'fail':
            $scope.filterObj.state = "-1";
            break;
          default:
            // statements_def
            break;
        }
      }
    }
  ])
